Refactorings that Split and Merge Programs
نویسندگان
چکیده
Program slicing is a well understood concept in the imperative paradigm, but so far there has been little work on program slicing in the context of functional languages. This paper describes a program slicing technique for Haskell that takes tuple-returning functions apart (called splitting); the converse of this is also described (called merging). The slicer is implemented as a transformation for the Haskell Refactorer, HaRe. Splitting functions is a useful transformation to allow the programmer to extract a particular subset of the functionality of a tuplereturning function into a new definition. Merging is a useful transformation because it allows many definitions to be merged together, thus eliminating duplicate code and encouraging code reuse. Splitting and merging can help to reduce dead code and increase program productivity and can be also used for debugging purposes.
منابع مشابه
Proving Termination of GHC Programs 1
A transformational approach for proving termination of parallel logic programs such as GHC programs is proposed. A transformation from GHC programs to term rewriting systems is developed; it exploits the fact that uniications in GHC-resolution correspond to matchings. The termination of a GHC program for a class of queries is implied by the termination of the resulting rewrite system. This appr...
متن کاملParallel System Using a Library of Basic Primitives: Modeling and Experimental Results?
We present a comparative study of implementations of the following sorting algorithms on the Parsytec SC320 reconfigurable, asynchronous, massively parallel MIMD machine: Bitonic Sort, Odd-Even Merge Sort, Odd-Even Merge Sort with guarded split&merge, and two variants of Samplesort. The experiments are performed on 2up to 5-dimensional wrapped butterfly networks with 8 up to 160 processors. We ...
متن کاملHinting Refactorings to Reduce Object Creation In Java
In this paper, we study refactorings that reduce the number of objects created in Java programs. More specifically, we present a tool that automatically identifies the locations in Java applications where such refactorings are useful. Initial experiments show that the refactorings can result in significant savings in terms of memory usage and execution time.
متن کاملormalizing Refactorings ith Graph Transformations
he widespread interest in refactoring —transforming the source-code of an objectriented program without changing its external behaviour— has increased the need or a precise definition of refactoring transformations and their properties. In this aper we explore the use of graph rewriting for specifying refactorings and their effect n programs. We introduce a graph representation for programs and...
متن کاملComposite Refactorings for Java Programs
There has been much interest in refactoring recently, but little work has been done on tool support for refactoring or on demonstrating that a refactoring does indeed preserve program behaviour. We propose a method for developing composite refactorings for Java programs in such a way that a rigorous demonstration of behaviour preservation is possible.
متن کامل